Skip to content

compositor: only release swapchain image in Submit if one was acquired - #431

Open
shakespear-dev wants to merge 2 commits into
Supreeeme:mainfrom
shakespear-dev:submit-release-guard
Open

shakespear-dev wants to merge 2 commits into
Supreeeme:mainfrom
shakespear-dev:submit-release-guard

Conversation

@shakespear-dev

@shakespear-dev shakespear-dev commented Sep 20, 2026 •

Copy link
Copy Markdown

Serious Sam VR The First Encounter (552450) crashes on every launch under xrizer with WiVRn on a Quest 3. The log ends with:

panicked at openxr-0.21.1/src/swapchain.rs:107:9:
wait_image must be called before release_image
   6: <xrizer::compositor::Compositor as openvr::bindings::vr::IVRCompositor029_Interface>::Submit

I think it could be the same crash as #364 (Serious Sam Fusion).

The problem is that submit_impl releases the swapchain image without checking that it was acquired.
The fix adds the image_acquired check to submit_impl. The dropped frame is skipped as before, and the next WaitGetPoses begins a frame normally.

I have added a test explicit_timing_submit_without_begun_frame that reproduces the panic without a headset:

cargo test --lib explicit_timing_submit_without_begun_frame

With the fix the game starts correctly. tests pass.

xrizer log from the crashing run (stock nightly, 0989a7f) just in case
[2026-09-17T23:47:40.936 INFO  xrizer ThreadId(1)] Initializing XRizer version 0.5.0
[2026-09-17T23:47:40.936 INFO  xrizer::clientcore ThreadId(1)] Creating ClientCore version "IVRClientCore_003"
[2026-09-17T23:47:41.010 INFO  xrizer::openxr_data ThreadId(1)] Creating OpenXR session with graphics API openxr::graphics::vulkan::Vulkan
[2026-09-17T23:47:41.010 INFO  xrizer::openxr_data ThreadId(1)] New session created!
[2026-09-17T23:47:41.010 INFO  xrizer::openxr_data ThreadId(1)] OpenXR session state changed: READY
[2026-09-17T23:47:41.010 INFO  xrizer::openxr_data ThreadId(1)] Began OpenXR session.
[2026-09-17T23:47:43.150 INFO  xrizer::compositor ThreadId(1)] Creating real backend for texture type Vulkan
[2026-09-17T23:47:43.150 INFO  xrizer::openxr_data ThreadId(1)] OpenXR session state changed: SYNCHRONIZED
[2026-09-17T23:47:43.150 INFO  xrizer::openxr_data ThreadId(1)] OpenXR session state changed: STOPPING
[2026-09-17T23:47:43.150 INFO  xrizer::openxr_data ThreadId(1)] OpenXR session state changed: IDLE
[2026-09-17T23:47:43.150 INFO  xrizer::openxr_data ThreadId(1)] OpenXR session state changed: EXITING
[2026-09-17T23:47:43.151 INFO  xrizer::openxr_data ThreadId(1)] Creating OpenXR session with graphics API openxr::graphics::vulkan::Vulkan
[2026-09-17T23:47:43.151 INFO  xrizer::openxr_data ThreadId(1)] New session created!
[2026-09-17T23:47:43.151 INFO  xrizer::openxr_data ThreadId(1)] OpenXR session state changed: READY
[2026-09-17T23:47:43.151 INFO  xrizer::openxr_data ThreadId(1)] Began OpenXR session.
[2026-09-17T23:47:43.157 INFO  xrizer::compositor ThreadId(1)] Received game texture, restarted session with new data
[2026-09-17T23:47:43.158 ERROR xrizer ThreadId(1)] panicked at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/openxr-0.21.1/src/swapchain.rs:107:9:
wait_image must be called before release_image
[2026-09-17T23:47:43.158 ERROR xrizer ThreadId(1)] Backtrace: 
   0: xrizer::init_logging::{{closure}}::{{closure}}
   1: std::panicking::panic_with_hook
   2: std::panicking::panic_handler::{closure#0}
   3: std::sys::backtrace::__rust_end_short_backtrace::<std::panicking::panic_handler::{closure#0}, !>
   4: __rustc::rust_begin_unwind
   5: core::panicking::panic_fmt
   6: <xrizer::compositor::Compositor as openvr::bindings::vr::IVRCompositor029_Interface>::Submit
   7: openvr::bindings::vr::ivrcompositor021::Submit
   8: _Z20IVRCompositor_SubmitI33u_IVRCompositor_IVRCompositor_02145IVRCompositor_IVRCompositor_021_Submit_paramsEiPT_PT0_b.constprop.0.isra.0
   9: IVRCompositor_IVRCompositor_021_Submit
  10: __wine_unix_call_dispatcher
  11: server_init_process_done
  12: main
  13: __libc_start_call_main
  14: __libc_start_main@@GLIBC_2.34
  15: _start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant